package com.wangshouyu.plugins.swagger;

import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.swagger2.configuration.Swagger2DocumentationConfiguration;

/**
 * @author 王守钰
 * @date 2021-12-27 09:40
 * @description swagger插件配置
 */
@Configuration
@ConditionalOnProperty(value = "swagger.plugin.enum-support", matchIfMissing = true)
@ConditionalOnBean(Swagger2DocumentationConfiguration.class)
public class SwaggerEnumPluginConfiguration {

    @Bean
    public EnumModelPropertyBuilderPlugin enumModelPropertyBuilderPlugin() {
        return new EnumModelPropertyBuilderPlugin();
    }
}